home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / PopUpFormatter / Controller.m < prev    next >
Text File  |  1995-06-12  |  745b  |  41 lines

  1. #import    <dbkit/dbkit.h>
  2. #import "Controller.h"
  3. #import "PopupFormatter.h"
  4. #import "RandomDataSource.h"
  5.  
  6. #define ROWCOUNT    20
  7. #define    COLUMNCOUNT    4
  8.  
  9. @implementation Controller
  10.  
  11. - appDidInit: sender
  12. {
  13.     int x;
  14.  
  15.     vector = [aDBTableView columnAt:1];
  16.     theFormatter = [[PopupFormatter alloc] init];
  17.     [vector setFormatter:theFormatter];
  18.  
  19.     theDataSource = [[RandomDataSource alloc] init];
  20.     [theDataSource setRows:ROWCOUNT];
  21.     [theDataSource setColumns:COLUMNCOUNT];
  22.     [theDataSource loadData];
  23.  
  24.     [aDBTableView setDataSource:theDataSource];
  25.     [aDBTableView setDelegate:self];
  26.     for (x = 0; x < 4; x ++)
  27.         [[aDBTableView columnAt: x] setIdentifier: (id)x];
  28.  
  29.     [aDBTableView display];
  30.  
  31.     return self;
  32. }
  33.  
  34. - free
  35. {
  36.     [theFormatter free];
  37.     return[super free];
  38. }
  39.  
  40. @end
  41.